﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RPGKata
{
    class Character
    {
        private String name;
        private int strength;
        private int dexterity;
        private int constitution;
        private Weapon weapon;
        private Armor armor;

        public Character(String n, int s, int d, int c, Weapon w, Armor a)
        {
            name = n;
            strength = s;
            dexterity = d;
            constitution = c;
            weapon = w;
            armor = a;
        }

        public String getName()
        {
            return name;
        }

        public int getStrength()
        {
            return strength;
        }

        public int getConstitution()
        {
            return constitution;
        }

        public int getDexterity() //i totally stole this verbatim from your example, kyle. was super slick, and i was super jealous.
        {
            if (armor != null && armor.getEncumbrance() > 0)
            {
                int adjustedDexterity = dexterity - armor.getEncumbrance();
                return adjustedDexterity >= 1 ? adjustedDexterity : 1;
            }
            return dexterity;
        }

        public Weapon getWeapon()
        {
            return weapon;
        }

        public Armor getArmor()
        {
            return armor;
        }

        public void output()//for testing purposes.
        {
            Console.WriteLine("=====================");
            Console.WriteLine("Name: " + name);
            Console.WriteLine("Strength " + strength);
            Console.WriteLine("Dexterity " + this.getDexterity());
            Console.WriteLine("Constitution" + constitution);
            if(weapon != null)
                weapon.output();
            if(armor != null)
                armor.output();
        }
    }
}
